#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void reverse(char* des, char* str)
{
	char tem = 0;
	while (des < str)
	{
		tem = *des;
		*des = *str;
		*str = tem;
		des += 1;
		str -= 1;

	}
}
int main()
{
	char dh[81] = { 0 };
	int i = 0;
	int j = 0;
	gets(dh);
	int sum = strlen(dh);
	reverse(dh, dh + sum - 1);
	for (j = 0; j < sum; j++)
	{
		if (dh[j] == ' ')
		{
			reverse(&dh[i], &dh[j]-1);
			i = j + 1;
		}
		else if (j == sum - 1)
		{
			reverse(&dh[i], &dh[j]);
		}
	}
	for (i = 0; i < sum; i++)
	{
		printf("%c", dh[i]);
	}
	return 0;
}